<p>
League List:
</p>
<table style="margin-right:100px; float:right">
    <tr>
        <form method="post" action="/league/process">
        <tr><th><button type="submit" name="orderBy" value="league">League</button></th></tr>
        <tr><th><button type="submit" name="orderBy" value="div">Division</button></th></tr>
        <tr><th><button type="submit" name="orderBy" value="con">Conference</button></th>
        </form>
    </tr>
</table>

<table border="1">
<?php
if ($groups != "undefined")
{
	echo "<tr><td>City</td><td>Team</td><td>Conference</td><td>Division</td><td>Members</td>";
	    foreach($groups as $group)
	    {
		    echo "<tr>";
		    echo "<td>" . $group->city . "</td>";
		    echo "<td><a href=\"" . $group->website .  "\">" . $group->team . "</a></td>";
		    echo "<td>" . $group->team['conf'] . "</td>";
		    echo "<td>" . $group->team['div'] . "</td>";
		    echo "<td>";
		    foreach($group->members->member as $member){
			    echo $member . "<br />";
		    }
		    echo "</td>";
		    echo "</tr>";
	    }
}
?>
</table>